<?php
/* User Management Subsystem */

class System_UMS {
									  
		private $adapter;
									  
//*************************************************************************************************
		public function __construct($adapter) 
		{
			$this->adapter = $adapter;
		}
		
//*************************************************************************************************
		public function userAdd($user) 
		{
			return $this->adapter->userAdd($user);
		}
		
//*************************************************************************************************
		public function userMod($user) 
		{
			$this->adapter->userMod($user);
		}
		
//*************************************************************************************************
		public function userDel($name) 
		{
			return $this->adapter->userDel($name);
		}
		
//*************************************************************************************************
		public function userGet($name) 
		{

			$userData = $this->adapter->userGet($name);

			if ($userData == null) return null;
			
			$user = new System_UMS_User(
									$userData['name'], 
									$userData['password'], 
									$userData['age'], 
									$userData['email']
									);	
			return $user;
		}
		
//*************************************************************************************************
		public function userGetAll() 
		{
			return $this->adapter->userGetAll();
		}
		
		
}